from TurtleWorld import *
from math import *
 
world=TurtleWorld()
pablo=Turtle()
pablo.delay = 0
 
#----------------------------TRIANGLES----------------------------#

def equilateral_tri(t, size=100, rotate=120):
    count = 1
    while count <= 4:
        t.fd(size)
        t.lt(rotate)
        count += 1
    
    
#--------------------------QUADRILATERALS-------------------------#

def para(t, width=100, height=100, angle=60, rotate=120):
    count = 1
    while count <= 4:
        t.fd(height)
        t.lt(angle)
        t.fd(width)
        t.lt(rotate)
        count += 1

def rhom(t, size=100, angle=120, rotate=60):
    count = 1
    while count <= 4:
        t.fd(size)
        t.lt(angle)
        t.fd(size)
        t.lt(rotate)
        count += 1
    
def rect(t, width=150, height=90, rotate=90):
    count = 1
    while count <= 4:
        t.fd(width)
        t.lt(90)
        t.fd(height)
        t.lt(90)
        count += 1
       
def square(t, side=100, rotate=0):
    for i in range(10):
        t.fd(side)
        t.rt()
    
    
def square(t, side):
    count = 1
    while count <= 4:
        t.fd(side)
        t.lt()
        count += 1
#------------------------------MOVEMENT---------------------------#

def line(t, x=100, y=100):
    dist = sqrt(x**2 + y**2)
    angle = degrees(atan(y/float(x)))
    t.lt(angle)
    t.fd(dist)
    t.rt(angle) 

def move(t, x, y):
    t.pu()
    dist = sqrt(x**2 + y**2)
    angle = degrees(atan(y/float(x)))
    t.lt(angle)
    t.fd(dist)
    t.rt(angle)
    t.pd()
#-----------test---------------#
#rhom(pablo, 100)
#rect(pablo)  
#para(pablo, width=100, height=100, angle=60, rotate=120)
#equilateral_tri(pablo, size=100, rotate=120)
#square(pablo, side=100)
#line(pablo, 100, 100)
#move(pablo, 100, 100)
#------------------------------OTHER SHAPES------------------------#
"""
Build any other shape functions you want.
Some Ideas:
    Right Triangles (sss, sas, etc)
    Arbitrary Triangles
    Circle
    Arcs
    Go Wild!
    
Bonus for working or challenging functions...no penalty for trying something
"""

#------------------------------TEST-------------------------------#



wait_for_user()